package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.KsAttachment;
import com.ruoyi.system.mapper.KsAttachmentMapper;
import com.ruoyi.system.service.IKsAttachmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 客诉工单附件Service业务层处理
 *
 * @author hjf
 * @date 2025-07-10
 */
@Service
public class KsAttachmentServiceImpl implements IKsAttachmentService {
    @Autowired
    private KsAttachmentMapper ksAttachmentMapper;

    /**
     * 查询客诉工单附件
     *
     * @param id 客诉工单附件主键
     * @return 客诉工单附件
     */
    @Override
    public KsAttachment selectKsAttachmentById(Long id) {
        return ksAttachmentMapper.selectKsAttachmentById(id);
    }

    /**
     * 查询客诉工单附件列表
     *
     * @param ksAttachment 客诉工单附件
     * @return 客诉工单附件
     */
    @Override
    public List<KsAttachment> selectKsAttachmentList(KsAttachment ksAttachment) {
        return ksAttachmentMapper.selectKsAttachmentList(ksAttachment);
    }

    /**
     * 新增客诉工单附件
     *
     * @param ksAttachment 客诉工单附件
     * @return 结果
     */
    @Override
    public int insertKsAttachment(KsAttachment ksAttachment) {
        ksAttachment.setCreateTime(DateUtils.getNowDate());
        return ksAttachmentMapper.insertKsAttachment(ksAttachment);
    }

    /**
     * 修改客诉工单附件
     *
     * @param ksAttachment 客诉工单附件
     * @return 结果
     */
    @Override
    public int updateKsAttachment(KsAttachment ksAttachment) {
        return ksAttachmentMapper.updateKsAttachment(ksAttachment);
    }

    /**
     * 批量删除客诉工单附件
     *
     * @param ids 需要删除的客诉工单附件主键
     * @return 结果
     */
    @Override
    public int deleteKsAttachmentByIds(Long[] ids) {
        return ksAttachmentMapper.deleteKsAttachmentByIds(ids);
    }

    /**
     * 删除客诉工单附件信息
     *
     * @param id 客诉工单附件主键
     * @return 结果
     */
    @Override
    public int deleteKsAttachmentById(Long id) {
        return ksAttachmentMapper.deleteKsAttachmentById(id);
    }
}
